declare module "isomorphic-fetch" {
  declare type InitOptions = {
    Promise?: $Subtype<Class<Promise<*>>>,
    XMLHttpRequest?: $Subtype<Class<XMLHttpRequest>>
  };

  // The below types are globals defined by Flow itself in bom.js, so we just have to tell it that the fetch export
  // of this module is equivalent to window.fetch
  declare type IsomorphicFetchExports = {
    fetch: (
      input: string | Request,
      init?: RequestOptions
    ) => Promise<Response>,
    Request: Request,
    Response: Response,
    Headers: Headers
  };

  declare export default function IsomorphicFetchConstructor(
    options?: InitOptions
  ): IsomorphicFetchExports;
}
